const Sequelize = require('sequelize');
module.exports = function(sequelize, DataTypes) {
  return sequelize.define('sp_goods_pics', {
    pics_id: {
      autoIncrement: true,
      type: DataTypes.INTEGER.UNSIGNED,
      allowNull: false,
      primaryKey: true,
      comment: "主键id"
    },
    goods_id: {
      type: DataTypes.MEDIUMINT.UNSIGNED,
      allowNull: false,
      comment: "商品id"
    },
    pics_big: {
      type: DataTypes.CHAR(128),
      allowNull: false,
      defaultValue: "",
      comment: "相册大图800*800"
    },
    pics_mid: {
      type: DataTypes.CHAR(128),
      allowNull: false,
      defaultValue: "",
      comment: "相册中图350*350"
    },
    pics_sma: {
      type: DataTypes.CHAR(128),
      allowNull: false,
      defaultValue: "",
      comment: "相册小图50*50"
    }
  }, {
    sequelize,
    tableName: 'sp_goods_pics',
    timestamps: false,
    indexes: [
      {
        name: "PRIMARY",
        unique: true,
        using: "BTREE",
        fields: [
          { name: "pics_id" },
        ]
      },
      {
        name: "goods_id",
        using: "BTREE",
        fields: [
          { name: "goods_id" },
        ]
      },
    ]
  });
};
